# -*- coding: utf-8 -*-
<%inherit file="/poll.mako"/>
%if c.message_alert:
<span>${c.message_alert}</span>
%endif

<table width="100%">
  <tbody>
%if c.list:
    <% 
    col_count = 0
    MAX_COLS = 2 
    %>
    %for row in c.list:
        <% col_count += 1 %>
        %if col_count == 1:
    <tr>
        %endif
      <td align="center"><a href="${h.url_for(action='vote',id=row.cdcandidato)}">${h.image_tag(''.join(['/imagens/poll/',str(row.r_candidato.idcandidato),'.jpg']),border=0, alt=row.r_candidato.nmcandidato,title=row.r_candidato.nmcandidato)}</a><br/>${row.r_candidato.nmcandidato}</td>        
        %if col_count == MAX_COLS:
            <% col_count = 0 %>
    </tr>
        %endif
    %endfor
    %if col_count < MAX_COLS and col_count > 0:
        %for i in range(col_count):
      <td>&nbsp;</td>
        %endfor
    </tr>
    %endif
%endif
  </tbody>
</table>